package cn.stylefeng.guns.sys.core.exception;

import cn.stylefeng.roses.kernel.model.exception.AbstractBaseExceptionEnum;

/**
 * @author gyz
 */
public class BusException extends RuntimeException {

    private int code;
    private String errmsg;

    public BusException() {
    }

    public BusException(int code, String errmsg) {
        super(errmsg);
        this.code = code;
        this.errmsg = errmsg;
    }

    public BusException(AbstractBaseExceptionEnum e) {
        super(e.getMessage());
        this.code = e.getCode();
        this.errmsg = e.getMessage();
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getErrmsg() {
        return errmsg;
    }

    public void setErrmsg(String errmsg) {
        this.errmsg = errmsg;
    }
}
